import {} from 'react';
import { ICardProps } from '@/types/common';
import { getImg } from '@/utils';
import styles from './index.module.less';

export default function Card (props: ICardProps) {
    const { name, allIndex } = props;
    console.log(name);
    return(
        <div className={styles['card']}>
            <div className={styles['wrapper']}>
                <img src={getImg(name || '白羊座')}/>
                <div className={styles['mask']}>
                    <span>{ name || '白羊座' }</span>
                    <p style={{display: `${allIndex ? 'inline' : 'none'}`}}>综合指数： { allIndex || 0 }</p>
                </div>
            </div>
        </div>
    );
}